﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Clipper.BLL.DetectChain;

namespace Clipper.ClipperUserControl
{
    /// <summary>
    /// UserDaiyMaintain.xaml 的交互逻辑
    /// </summary>
    public partial class UserDaiyMaintain : UserControl
    {
        public UserDaiyMaintain()
        {
            InitializeComponent();
        }
        #region 管路清理
        private void btnClearCanal_Click(object sender, RoutedEventArgs e)
        {
            AddReagent1AndSample.Kit1.WaitStatus(AddReagent1AndSample.Kit1.Reset());
            AddReagent1AndSample.Kit1.WaitStatus(AddReagent1AndSample.Kit1.Position(1));
            AddReagent2.Kit2.WaitStatus(AddReagent2.Kit2.Reset());
            AddReagent2.Kit2.WaitStatus(AddReagent2.Kit2.Position(1));
            ClearCanalArm(AddReagent1AndSample.SA);
            ClearCanalArm(AddReagent1AndSample.SB);
            ClearCanalArm(AddReagent1AndSample.R1A);
            ClearCanalArm(AddReagent1AndSample.R1B);
            ClearCanalArm(AddReagent2.R2A);
            ClearCanalArm(AddReagent2.R2B);

        }
        private void ClearCanalArm(Communication.ArmControl arm)
        {
            arm.WaitStatus(arm.Reset());
            arm.WaitStatus(arm.Imbibe(0));
            arm.WaitStatus(arm.Inject());
            arm.WaitStatus(arm.Rinse());
            arm.WaitClearCanal();

        }
        private void ClearCanalWash()
        {
            DeliveryWarehouse.DeliveryControl.WaitStatus(DeliveryWarehouse.DeliveryControl.CupIn());
            
            DeliveryWarehouse.DeliveryControl.Back2000();

        }
        #endregion 


    }
}
